<template>
  <div>
    <!-- 把整体看作一个table -->
    <el-col class="el-col">
      <!-- 头部区域 -->
      <div class="colhead">
        <!-- dataUrls包含formName、placeHolder和url三个属性 -->
        <Web_search_box class="row" v-bind:search-req-url="mySearchUrl" :data-urls="myDataUrls" @SearchResult="mySearch"></Web_search_box>
      </div>
    </el-col>

    <!--Result_form @rowClicked="myClikcEvent" @rowSelected="HandleSelect" v-bind:type-before="myTypeBefore" v-bind:table-head-json-array="myTableHead" v-bind:addition-btns="myAdditionBtns"></Result_form-->
    <Result_form :request-u-r-l="baseUrl" :table-head-json-array="myTableHead" :op-base-url="opBaseUrl" :type-before="myTypeBefore" :addition-btns="myAdditionBtns"></Result_form>

  </div>
</template>



<script>
  import Web_search_box from "../components/myUtil/Web_search_box";
  import Result_form from "../components/myUtil/Result_form";
  export default {
    components: {Result_form, Web_search_box},
    data() {
      return {
        mySearchUrl:localStorage.getItem('reqBaseUrl') + '/api/college/search',
        myDataUrls:[{formName:'schoolId',placeHolder:'所属学校',url:localStorage.getItem('reqBaseUrl') + '/api/school/search'}],
        opBaseUrl:localStorage.getItem('reqBaseUrl') + '/api/college',
        baseUrl:localStorage.getItem('reqBaseUrl') + '/api/college/search?',
        myTypeBefore:[],
        myTableHead: [{colName:'id',showName:'id',inModel:false},{colName:'name',showName:'学院名称'},
          {colName: 'school',showName: '所属学校',isJson:true, rename:'schoolId',from:localStorage.getItem('reqBaseUrl') + '/api/school/search'},
          {colName: 'isEnabled',showName: '审核状态',inModel:false}],
        myAdditionBtns:[{myStyle:'btn btn-success',name:'审核通过'},{myStyle:'btn btn-warning',name:'查看'},{myStyle:'btn btn-danger',name:'锁定'}],
        mySelections:[],
      };
    },
    methods: {
      mySearch(url){
        this.baseUrl = url
      }
    }
  };
</script>


<style scoped>
  .colhead {
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
  }
</style>
